let now = new Date();
console.log(now);
console.log(`年 = ${now.getFullYear()}`);
console.log(`月 = ${now.getMonth()}`);
console.log(`日 = ${now.getDate()}`);
console.log(`星期几 = ${now.getDay()}`);
console.log(`时 = ${now.getHours()}`);
console.log(`分 = ${now.getMinutes()}`);
console.log(`秒 = ${now.getSeconds()}`);
console.log(`毫秒 = ${now.getMilliseconds()}`);
console.log(`时间戳 = ${now.getTime()}`);
console.log(now.toLocaleTimeString());
console.log(now.toUTCString());
console.log(now.toISOString());
console.log(now.toTimeString());

/*
输出结果:
年 = 2020
月 = 5
日 = 8
星期几 = 1
时 = 19
分 = 54
秒 = 30
毫秒 = 758
时间戳 = 1591617270758
19:54:30
Tue, 09 Jun 2020 02:16:31 GMT
2020-06-09T02:16:31.179Z
10:16:31 GMT+0800 (GMT+08:00)
 */